#include<iostream>
#include <unistd.h>
#include"ThreadPoolSingle.hpp"
#include"task.hpp"
#include<ctime>
using namespace std;



int main()
{
    cout << "start "<<endl;
    srand(time(nullptr));
    ThreadPool<task>::GetInstance()->start();
    while (1)
    {
        //构建任务
        int x = rand() % 10;
        usleep(20);
        int y = rand() % 10 +1;
        char op = opers[rand() % opers.size()];
        task t(x,y,op);

        ThreadPool<task>::GetInstance()->push(t);
        sleep(1);
    }
    
    return 0;
}